﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Upeu.Matricula.Data.Business;
using Upeu.Matricula.Data.Entities;

namespace Upeu.Matricula.Data.Test.Business
{
    [TestClass]
    public class NotaBusinessTest
    {
        [TestMethod]
        public void TestGetListByFilter()
        {
            var lista = NotaBusiness.GetList("");
            Assert.IsTrue(lista.Count > 0);
        }

        [TestMethod]
        public void TestCreate()
        {
            Nota nuevo = new Nota
            {
                StudentId = new Guid("43ed3edb-181a-e511-8287-28e347b34492"),
                CursoId = new Guid("57a7e229-191a-e511-8287-28e347b34492"),
                CursoNot = "20",
                Promedio = "18",
                FechaI = DateTime.Now
            };
            Nota c = NotaBusiness.Create(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }

        [TestMethod]
        public void TestUpdate()
        {
            Nota nuevo = new Nota
            {
                Id = new Guid("17f1f0b2-99df-e411-84bc-e069958900b1"),
                StudentId = new Guid("5caae3b8-7118-e511-bea2-089e015aa412"),
                CursoId = new Guid("2e43bb27-161a-e511-8287-28e347b34492"),
                CursoNot = "46464",
                Promedio = "20",
                FechaI = DateTime.Now
            };
            Nota c = NotaBusiness.Update(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }
    }
}
